<template>
	<view class="page">
		<scroll-view scroll-y="true" style="flex: 1; padding: 16rpx; width: 100%;">
			<rich-text :nodes="content"></rich-text>
		</scroll-view>
		<view style="display: flex; flex-direction: row; margin: 8rpx; align-content: space-between;">
			<u-button type="primary" text="我接受协议" @click="accept"></u-button>
			<u-button type="warning" text="我不接受协议" @click="reject"></u-button>
		</view>
	</view>
</template>

<script>
	import route from '../../uni_modules/uview-ui/libs/util/route'
	import {
		loadProtocol
	} from '@/common/api.js'
	export default {
		data() {
			return {
				content: ''
			}
		},
		onLoad() {
			loadProtocol().then(pojo => {
				this.content = pojo.data
			})
		},
		methods: {
			accept() {
				uni.redirectTo({
					url: "/pages/login/login"
				})
			},
			reject() {
				uni.exitMiniProgram()
			}
		}
	}
</script>

<style>
	.page {
		width: 100%;
		height: 100vh;
		display: flex;
		flex-direction: column;
		align-items: stretch;
		box-sizing: border-box;
	}

	.content {
		font-size: 12pt;
		padding: 12rpx;
		/* border: 1rpx solid gray; */
		width: 100%;
		height: 100%;
		background-color: antiquewhite;
	}
</style>